package com.zxf.basic.base

import android.view.LayoutInflater
import androidx.viewbinding.ViewBinding

/**
 * @author zjc
 * @date 2022/12/16
 */
abstract class BindingActivity<VB: ViewBinding>(private val inflate: (layoutInflater: LayoutInflater) -> VB) : BaseActivity() {

    lateinit var binding: VB
    private set

    override fun layout(): Int {
        binding = inflate.invoke(layoutInflater)
        setContentView(binding.root)
        return 0
    }

}